package com.ken.callblock2.service;

import com.ken.callblock2.listener.PhoneCallListener;

import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.media.AudioManager;
import android.os.IBinder;
import android.telephony.TelephonyManager;
import android.util.Log;

public class CallBlockService extends Service {

	private PhoneCallListener mPhoneCallListener;
	private TelephonyManager mTelephonyManager;
	// private PhoneStateListener mPhoneStateListener;
	private AudioManager mAudioManager;
	
	@Override
	public IBinder onBind(Intent intent) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void onCreate() {
		// TODO Auto-generated method stub
		mPhoneCallListener = new PhoneCallListener(this);
		mTelephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
		mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
		mTelephonyManager.listen(mPhoneCallListener, PhoneCallListener.LISTEN_CALL_STATE);
		// mTelephonyManager.listen(mPhoneCallListener,
		// PhoneCallListener.LISTEN_SERVICE_STATE);
		// mTelephonyManager.listen(mPhoneCallListener,
		// PhoneCallListener.LISTEN_DATA_CONNECTION_STATE);
		super.onCreate();
	}
	
	@Override
	public int onStartCommand(Intent intent, int flags, int startId) {
		// TODO Auto-generated method stub
		return START_STICKY;
	}
	
	@Override
	public void onStart(Intent intent, int startId) {
		// TODO Auto-generated method stub
		super.onStart(intent, startId);
	}
}
